import operate from '@dfeidao/atom-nodejs/db/operate';
import log from '@dfeidao/atom-nodejs/logger/log';
import { systemid } from '../../atom/config';

interface Message {
	fitle: {
		equip_no: string
		hidden_source: string
	};
}

export default async function atom(msg: Message, action_id: string, session_id: string) {
	log(`Service begin`);
	// todo
	const { insert, exec } = operate(action_id, session_id, systemid);
	insert('equip_hazard_source', {
		equip_no: msg.fitle.equip_no,
		hidden_source: msg.fitle.hidden_source
	});

	const rs = await exec();
	log(`Service end`);
	return rs;
}
